/**
 * This project create for studying propose at BUPT University. You can change or reuse this project anywhere
 */

package edu.bupt.ooad.library.ui;

import java.awt.BorderLayout;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.border.EmptyBorder;

import edu.bupt.ooad.library.Library;

/**
 * @author Hamed Abdollahpour
 */
public class MainFrame extends JFrame {

    private JPanel contentPane;

    /**
     * Create the frame.
     */
    public MainFrame(Library library) {
        setTitle("Simple Library managment v0.1");
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setBounds(100, 100, 800, 500);
        contentPane = new JPanel();
        contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
        contentPane.setLayout(new BorderLayout(0, 0));
        setContentPane(contentPane);

        JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
        contentPane.add(tabbedPane, BorderLayout.CENTER);

        BarrowPanel barrowPanel = new BarrowPanel(library);
        tabbedPane.addTab("Barrow/Return", null, barrowPanel, null);

        PatronPanel perPanel = new PatronPanel(library);
        tabbedPane.addTab("Petorns management", null, perPanel, null);

        BooksPanel booksPanel = new BooksPanel(library);
        tabbedPane.addTab("Book managements", null, booksPanel, null);
    }

}
